home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / lo_pas.com / TEST123.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-05-27  |  3.5 KB  |  76 lines

  1. {$N+,E+}  (*  $N+ compiles for math coprocessor which will be used *)
  2.           (*  automatically if available.  E+ activates the        *)
  3.           (*  80X87 emulator which will be used if a coprocessor   *)
  4.           (*  is not present.  I understand that these are program *)
  5.           (*  wide options and cannot be used in a unit separately *)
  6.  
  7. (*  Written by Dan Glanz, Alexandria, Virginia (76672,2572), May, 1989. *)
  8. (*  as a public service.                                                *)
  9. (*  There are no restrictions on use and no gaurantees that it works.   *)
  10.  
  11. (*    All I ask is a smidgeon of credit.                          *)
  12. (*  If you include this in a program, leave the credit line in. *)
  13. (*  If you modify the unit, add your own credit line.           *)
  14.  
  15.  
  16. Program Test123;
  17. uses crt, dos, Unit123;
  18.  
  19. (****************************************************************)
  20. (*              Demonstration and test program                  *)
  21. (*                                                              *)
  22. (*     This demonstration is to be used with the unit "UNIT123" *)
  23. (*     which is in the same ARC file.                           *)
  24. (*                                                              *)
  25. (*     Reads any Lotus file and copies the file read to another *)
  26. (*     file minus any blank cells, cells containing format      *)
  27. (*     range names and other information.  Formulas are not     *)
  28. (*     copied but the current value of formats is copied to the *)
  29. (*     new file as a real cell value. The new file will be      *)
  30. (*     located in the same directory and will have the same     *)
  31. (*     name as the old file except that the extension will      *)
  32. (*     be set to ".WK!".                                        *)
  33. (*                                                              *)
  34. (*     Pauses after each cell is read and displays the contents *)
  35. (*     of the cell.  Press any key to continue.                 *)
  36. (*                                                              *)
  37. (****************************************************************)
  38.  
  39. var
  40.     Response : char;
  41.  
  42. begin
  43.     Write('Enter name of Lotus File ');    {Get the file path name}
  44.     Readln(Lotus_Read_File_Name);
  45.  
  46.     Open_Lotus_Read_File;        {Open a WKS, WK1 file and read version  }
  47.  
  48.     Make_New_File_Name;          {Make new file name with .WK! extension }
  49.  
  50.     Open_Lotus_Write_File;       {Open the new file for writing          }
  51.  
  52.     repeat
  53.         Read_Lotus_Record ;
  54.         Print_Lotus_Record;               {Display record read (except }
  55.                                           {blank records, which are a  }
  56.                                           {waste of time               }
  57.  
  58.         Write_Lotus_Record;               {Write the record read to the}
  59.                                           {new file}
  60.  
  61.         Response := ReadKey;            {Pause after reading, writing and   }
  62.          If Response = #27 then          {printing each record.     }
  63.             begin                       {Press any key to continue }
  64.                 Close_Lotus_Write_File; {or Esc to stop.  If you   }
  65.                 halt;                   {stop in the middle of     }
  66.             end;                        {copying, the new file will}
  67.                                         {still be usable.          }
  68.     until Lotus_End_Of_File;
  69.  
  70.  
  71.     Close_Lotus_Write_File;                {Writes a Lotus end of file}
  72.                                            {and closes the file}
  73.  
  74.     Writeln('Done reading and writing.');
  75.  
  76. end.